{
  "properties" : { },
  "id" : "42e3a3a2c11b4c78adce3a4685b29ca4",
  "script" : null,
  "groupId" : "683dcdbedb874d21b145c74f30d762d2",
  "name" : "ID",
  "createTime" : null,
  "updateTime" : 1668125465949,
  "lock" : null,
  "createBy" : null,
  "updateBy" : null,
  "path" : "/byID",
  "method" : "DELETE",
  "parameters" : [ ],
  "options" : [ ],
  "requestBody" : "",
  "headers" : [ ],
  "paths" : [ ],
  "responseBody" : null,
  "description" : null,
  "requestBodyDefinition" : null,
  "responseBodyDefinition" : null
}
================================
import log;
import response;
//读取上传文件根目录
import '@/evn/fileRootPath' as fileRootPath;
//调用java
import com.neusoft.weekreport.component.FileUtil.deleteFile;
//导入java.io.File包
import java.io.File;

//1.根据删除目录的ID获取目录路径
var sql = """ select PATH from as_group where ID = #{body.id} """
var reu = db.select(sql).map(e => e.PATH);
var path = reu.get(0);
//2.获取删除的绝对路径
File dir = new File(fileRootPath() + path);
//3.调用Java删除文件接口类
if (deleteFile.deleteFile(dir)) {
    System.out.println("文件删除成功!");
    var delsql = """ delete from as_group where ID = #{body.id} """
    return db.update(delsql)
} else {
    return response.json({
        success: false,
        message: '删除失败,请检查目录是否存在',
        code: 0
    });
}